package com.fruit.mapper.pay;

import java.util.List;

import com.fruit.pojo.common.OperatingConfig;
import com.fruit.pojo.order.Bill;
import com.fruit.pojo.order.Order;
import com.fruit.pojo.order.OrderGoods;
import com.fruit.pojo.order.OrderInvoice;
import com.fruit.pojo.order.OrderReceiver;
import com.fruit.pojo.pay.PayInfo;
import com.fruit.pojo.pay.TransactionFlow;
import com.fruit.pojo.pay.TransactionFlowReserve;

public interface PayMapper {

	/**
	 * 保存订单信息
	 * @param order
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveOrder(Order order);
	
	
	/**
	 * 保存交易流水
	 * @param transactionFlow
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveTransactionFlow(TransactionFlow tf);
	
	/**
	 * 保存交易流水附表（订金+尾款）
	 * @param tfr
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveTransactionFlowReserve(TransactionFlowReserve tfr);
	
	/**
	 * 保存账单信息
	 * @param bill
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveBillDetail(Bill bill);
	
	/**
	 * 保存订单商品信息
	 * @param og
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveOrderGoods(OrderGoods og);
	
	/**
	 * 保存订单收货信息
	 * @param or
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveOrderReceiver(OrderReceiver or);
	
	/**
	 * 保存订单发票信息
	 * @param oi
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int saveOrderInvoice(OrderInvoice oi);
	
	/**
	 * 保存支付信息
	 * @param pi
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int savePayInfo(PayInfo pi);
	
	/**
	 * 获取支付信息
	 * @param pi
	 * @return
	 * @author admin
	 * @version 2017
	 */
	PayInfo getPayInfoById(PayInfo pi);
	
	/**
	 * 修改商品库存
	 * @param og
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int updateGoodsStockNum(OrderGoods og);

	/**
	 * 修改商品库存
	 * @param og
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int updateAddGoodsStockNum(OrderGoods og);
	
	/**
	 * 
	 * @return
	 * @author admin
	 * @version 2017
	 */
	List<OperatingConfig> getOperatingConfig();
	
	TransactionFlow getTransactionById(long id);
}
